#!/bin/bash
file="permission_check.sh"
ppath="/etc"
#check if we have run[x] permission of file
echo "check permission of $file"
if [ -x $file ];then
    echo "We have x permission of file $file"
else
    echo "We don't have x permission of file $file"
fi

#check if we have write permission of path 
echo "check permission of $ppath"
if [ -w $ppath ];then
    echo "We have w permission of file $ppath"
else
    echo "We don't have w permission of file $ppath"
fi

#check if we have read permission of path 
echo "check permission of $ppath"
if [ -r $ppath ];then
    echo "We have r permission of file $ppath"
else
    echo "We don't have r permission of file $ppath"
fi
